<? 
	include('base.php');
	User::protect();
	$section = 'band_gps';
	include_class('band_gps');
	
	if ($_POST['submit']) { 
		// add news entry
		$gp = BandGuestPerformer::add($_POST);
		if (!db::isError($gp)) {
			header('Location: band_gp_edit.php?id=' . $gp->getID());
			exit;
		}
	}
	$editors = array('description');
	$page_title = 'Add Guest Performer';
	include('layout/header.php');
	
?>

<div id="breadcrumb">
	<a href="index.php">Audition&nbsp;&#62;</a>&nbsp;<a href="band.php">Manage&nbsp;Band&nbsp;&#62;</a>&nbsp;<a href="band_gps.php">Guest Performers&nbsp;&#62;</a>&nbsp;Add Guest Performer
</div>

<?	if (User::isAdmin()) { 

	if (db::isError($gp)) {
		$gp->outputList();
	}
	?>
		
	<h1>add guest performer:</h1>
	<div class="inset">
	<form id="edit_entry" action="<?=$PHP_SELF?>" method="post">
	<table border="0" cellspacing="0" cellpadding="0" class="edit-form">
	<tr>
		<td width="50%"><strong>Last Name</strong><br/><input class="text" type="text" name="lastname" value="<?=$_POST['lastname']?>"></td>
		<td width="50%"><strong>First Name</strong><br/><input class="text" type="text" name="firstname" value="<?=$_POST['firstname']?>"></td>
	</tr>
	<tr>
		<td><strong>Function</strong><br/><input type="text" class="text" name="function" value="<?=$_POST['function']?>"></td>
		<td><strong>Website</strong><br/><input type="text" class="text" name="website" value="<?=$_POST['website']?>"></td>
	</tr>
	</table>
	<div class="edit-form">
	<strong>Description</strong><br/>
	<textarea class="full" name="description" id="description"><?=$_POST['description']?></textarea>
	</div>
	
	<div class="edit-form">
		<input type="submit" value="Add Performer" name="submit" class="button">
		<input type="submit" value="Return to Guest Performers" name="preview" onclick="location.href='band_gps.php'; return false" class="button">
	</div>
	</form>
	</div>
	
<? } else { ?>

	<?=Error::outputDialog('Return to Guest Performers','band_gps.php', 'You do not have permission to add a guest performer.')?>

<? } ?>

<? include('layout/footer.php'); ?>
